Skip to content

Conversation

@Pijukatel
Copy link
Contributor

@Pijukatel Pijukatel commented Feb 9, 2026

Description

  • Fix a rare scenario where RequestQueue is in an invalid state due to a failed API call to mark the request as handled. This invalid state can lead to a crawler deadlock.
  • Fixed only for ApifyRequestQueueSingleClient, as for the shared client, it is not possible to distinguish between API failure and external modification of the queue on the platform.

Issues

Testing

  • Added unit test

Checklist

  • [] CI passed

@github-actions github-actions bot added this to the 134th sprint - Tooling team milestone Feb 9, 2026
@github-actions github-actions bot added t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics. labels Feb 9, 2026
@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.11%. Comparing base (aa0fa9d) to head (425093b).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
...age_clients/_apify/_request_queue_shared_client.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #768      +/-   ##
==========================================
+ Coverage   81.91%   82.11%   +0.19%     
==========================================
  Files          46       46              
  Lines        2693     2695       +2     
==========================================
+ Hits         2206     2213       +7     
+ Misses        487      482       -5     
Flag Coverage Δ
integration 56.17% <81.81%> (+0.21%) ⬆️
unit 68.01% <0.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Pijukatel Pijukatel force-pushed the fix-rq-state-when-marking-ashandled-fails branch from 55bc2a2 to b4bed05 Compare February 9, 2026 10:42
Comment on lines -238 to +239
except Exception as exc:
logger.debug(f'Error marking request {request.unique_key} as handled: {exc!s}')
except Exception:
logger.exception(f'Error marking request {request.unique_key} as handled.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will logger.exception still include the traceback if we're not using {exc!s}?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it comes with default exc_info=True

@Pijukatel Pijukatel force-pushed the fix-rq-state-when-marking-ashandled-fails branch from b4bed05 to 6db57ef Compare February 10, 2026 08:27
@Pijukatel Pijukatel force-pushed the fix-rq-state-when-marking-ashandled-fails branch from 6db57ef to 425093b Compare February 10, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix rare case when crawler can get deadlocked

2 participants